link_libraries(cppkafka ${RDKAFKA_LIBRARY} ${Boost_LIBRARIES} pthread rt ssl crypto dl z)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../include)
include_directories(SYSTEM ${RDKAFKA_INCLUDE_DIR})

add_custom_target(examples)
macro(create_example example_name)
    string(REPLACE "_" "-" sanitized_name ${example_name})
    add_executable(${sanitized_name} EXCLUDE_FROM_ALL "${example_name}_example.cpp")
    add_dependencies(examples ${sanitized_name})
endmacro()

create_example(producer)
create_example(buffered_producer)
create_example(consumer)
create_example(consumer_dispatcher)
create_example(metadata)
create_example(consumers_information)
